
#include "chuankoutiaos.h"
#include "ui_chuankoutiaos.h"
#include<QTableWidget>
#include<QtDebug>
#include"quanjvbianliang.h"
//#include"globalvariale.h"
//GlobalVariale *lan = new GlobalVariale;
chuankoutiaos::chuankoutiaos(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::chuankoutiaos)
{
    ui->setupUi(this);
    //ui->tableWidget->setColumnCount(2);
    //ui->tableWidget->setRowCount(20);

    //QLCDNumber *m_pLCD = new QLCDNumber(this);
    //m_pLCD->setDigitCount(2); //显示位数
    // 设置显示的模式为十进制
    //m_pLCD->setMode(QLCDNumber::Dec);
    // 设置显示外观
    //m_pLCD->setSegmentStyle(QLCDNumber::Flat);
    // 设置样式
    //m_pLCD->setStyleSheet("border: 1px solid green; color: green; background: silver;");

    //m_pLCD->

    ui->lcdNumber->setDigitCount(3);

    void (QComboBox:: *p)(int) = &QComboBox::currentIndexChanged;
    connect(ui->comboBox,p,[=](){
        qDebug()<<ui->comboBox->currentText();
    });
    void (QComboBox:: *p1)(int) = &QComboBox::currentIndexChanged;
    connect(ui->comboBox_2,p1,[=](){
        qDebug()<<ui->comboBox_2->currentText();
    });
    void (QComboBox:: *p2)(int) = &QComboBox::currentIndexChanged;
    connect(ui->comboBox_3,p2,[=](){
        qDebug()<<ui->comboBox_3->currentText();
    });
    void (QComboBox:: *p3)(int) = &QComboBox::currentIndexChanged;
    connect(ui->comboBox_4,p3,[=](){
        qDebug()<<ui->comboBox_4->currentText();
    });
    void (QComboBox:: *p4)(int) = &QComboBox::currentIndexChanged;
    connect(ui->comboBox_5,p4,[=](){
        qDebug()<<ui->comboBox_5->currentText();
    });
    connect(ui->action_16,&QAction::triggered,[=](){
        qDebug()<<"退出";
    });
    connect(ui->action_14,&QAction::triggered,[=](){
        qDebug()<<"清空串口";
    });
    connect(ui->action_13,&QAction::triggered,[=](){
        qDebug()<<"计数清零";
    });
    connect(ui->action_11,&QAction::triggered,[=](){
        qDebug()<<"读取间隔";
    });
    connect(ui->action_9,&QAction::triggered,[=](){
        qDebug()<<"写入数据";
    });
    connect(ui->action_8,&QAction::triggered,[=](){
        qDebug()<<"读取数据";
    });
    connect(ui->action_7,&QAction::triggered,[=](){
        qDebug()<<"保存数据";
    });
    connect(ui->action_5,&QAction::triggered,[=](){
        qDebug()<<"关闭串口";
    });
    connect(ui->action_4,&QAction::triggered,[=](){
        qDebug()<<"打开串口";
    });
    connect(ui->action_2,&QAction::triggered,[=](){
        qDebug()<<"添加串口";
    });
    connect(ui->action_17,&QAction::triggered,[=](){
        qDebug()<<"关于";
    });
}

chuankoutiaos::~chuankoutiaos()
{
    delete ui;
}


void chuankoutiaos::on_pushButton_3_clicked()//发送pushbutton
{
    qDebug()<<ui->lineEdit->text();
}

void chuankoutiaos::on_pushButton_2_clicked()
{
    qDebug()<<"清空显示";
}

void chuankoutiaos::on_radioButton_4_clicked()
{
    qDebug()<<" DEC-字符";
}

void chuankoutiaos::on_radioButton_3_clicked()
{
    qDebug()<<"字符-HEX";
}

void chuankoutiaos::on_radioButton_2_clicked()
{
    qDebug()<<"字符-字符";
}
